package com.neuedu.hisboot.controller;

import com.neuedu.hisboot.dto.DoctorScheduleDTO;
import com.neuedu.hisboot.dto.Result;
import com.neuedu.hisboot.service.ISchedulingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author jaun
 * @since 2025-07-04
 */
@RestController
@RequestMapping("/scheduling")
public class SchedulingController {
    @Autowired
    private ISchedulingService schedulingService;
    @GetMapping("/doctor")
    public Result<List<DoctorScheduleDTO>> getDoctorSchedules(
            @RequestParam Integer deptId,
            @RequestParam Integer userId,
            @RequestParam(required = false) Integer registLevelId) {

        List<DoctorScheduleDTO> schedules = schedulingService.getDoctorSchedules(
                deptId, userId, registLevelId
        );

        return Result.success(schedules);
    }
}
